package de.siro.notie_surface;

import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Paint;

import de.siro.notie_surface.MainActivity.SurfaceThread;

public class Note implements Comparable<Note> {
	Bitmap note;
	SurfaceThread sT;
    public volatile float x, y;
    boolean move = false;
    private Paint paint=null;

	public Note(SurfaceThread surfaceThread, Bitmap note, float x2, float y2) {
		this.note = note;
		this.sT = surfaceThread;
		this.x = x2;
		this.y = y2;
	}

	public void setBitmap(Bitmap note){
		this.note=note;
	}
	public void setPaint(Paint paint){
		this.paint=paint;
	}

	public void onDraw(Canvas c, float scroll) {

		c.drawBitmap(note, (x - note.getWidth() / 2) - scroll,
				y - (int)(note.getHeight() *0.883), paint);

	}

	@Override
	public int compareTo(Note n) {
		if (this.x > n.x)
			return 1;
		else
			return -1;

	}

}
